<script lang="ts" setup name="App">
import {RouterView,RouterLink} from "vue-router";
import Header from "@/components/Header.vue";
</script>
<template>
  <div id="app">
    <Header></Header>
<!--    //多个RouterView的用法-->
    <RouterView name="top" />
<!--    导航区-->
    <div class="navigate">
      <RouterLink to="/"  active-class="active">首页</RouterLink>
      <RouterLink :to="{name:'about'}" active-class="active">新闻</RouterLink>
      <RouterLink :to="{path:'/news'}" active-class="active">关于</RouterLink>
    </div>
<!--    展示区-->
    <div class="main-content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<style scoped>

  .navigate{
    margin: 20px 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    a{
      padding: 10px 20px;
      background: #a2a0a0;
      border-radius: 10px;
      text-decoration: none;
      font-size: 16px;
      color: white;
    }
    .active{
      background: #74917d;
      color: #ddb363;
    }
  }
  .main-content{
    border-radius: 20px;
    border: 1px solid black;
    height: 500px;
  }
</style>